package it.polimi.jita.cp.block.de;

import it.polimi.jita.cp.block.Input;

import java.util.List;

public class DemandEstimatorInput extends Input {
	private List<IInstantDemandEstimatorData> instants;
	private Integer vCpuNum;
	private Integer samplingTime;
	private String oFilePath;

	public DemandEstimatorInput(List<IInstantDemandEstimatorData> instants,
			Integer samplingTime, String oFilePath, boolean isWithHeaders,
			Integer vCpuNum) {
		this.instants = instants;
		this.vCpuNum = vCpuNum;
		this.samplingTime = samplingTime;
		this.oFilePath = oFilePath;
	}

	protected List<IInstantDemandEstimatorData> getInstants() {
		return instants;
	}

	protected double getSamplingTimeDbl() {
		return (double) samplingTime;
	}

	protected String getoFilePath() {
		return oFilePath;
	}

	protected Integer getvCpuNum() {
		return vCpuNum;
	}

	public static class Instant implements IInstantDemandEstimatorData {
		private Double block;
		private Double wait;
		private Double run;
		private Double demand;

		protected Instant(Double block, Double wait, Double run) {
			super();
			this.block = block;
			this.wait = wait;
			this.run = run;
		}

		@Override
		public Double getBlock() {
			return block;
		}

		@Override
		public Double getWait() {
			return wait;
		}

		@Override
		public Double getRun() {
			return run;
		}

		@Override
		public Double getDemand() {
			return demand;
		}

		@Override
		public void setDemand(Double demand) {
			this.demand = demand;
		}

		protected Double getBlockPercent() {
			return block * 100;
		}

		protected Double getWaitPercent() {
			return wait * 100;
		}

		protected Double getRunPercent() {
			return run * 100;
		}

	}

}
